inherited FPesquisaSaldoEstoque: TFPesquisaSaldoEstoque
  Left = 261
  Top = 156
  Caption = 'Pesquisa Saldo Estoque'
  ClientHeight = 332
  OldCreateOrder = True
  PixelsPerInch = 96
  TextHeight = 13
  inherited Panel2: TPanel
    inherited BtnLimpar: TBitBtn
      OnClick = BtnLimparClick
    end
    inherited BtnImprimir: TBitBtn
      OnClick = BtnImprimirClick
    end
  end
  inherited Panel1: TPanel
    Height = 291
    object Label3: TLabel [0]
      Left = 5
      Top = 0
      Width = 26
      Height = 13
      Caption = 'Local'
    end
    object Label2: TLabel [1]
      Left = 297
      Top = 44
      Width = 53
      Height = 13
      Caption = 'Data Saldo'
    end
    object Label1: TLabel [2]
      Left = 205
      Top = 0
      Width = 69
      Height = 13
      Caption = 'Grupo Produto'
    end
    object Label7: TLabel [3]
      Left = 5
      Top = 92
      Width = 65
      Height = 65
      Caption = 'Classifica'#231#227'o '#13#10#13#10'do'#13#10#13#10'Produto'
    end
    object Label4: TLabel [4]
      Left = 7
      Top = 44
      Width = 54
      Height = 13
      Caption = 'Fornecedor'
    end
    object SpeedButton1: TSpeedButton [5]
      Left = 384
      Top = 170
      Width = 23
      Height = 26
      Glyph.Data = {
        76060000424D7606000000000000360400002800000018000000180000000100
        0800000000004002000000000000000000000001000000000000FFFFFF00CFC8
        CF00808780007F7F7F0040404000FFFF3F00BFBF3F005F5F3F003F3F3F00FF97
        2F00FF672F008080200020202000FFFF00009F9F0000808000007F7F00006060
        00005F5F000020200000FF0000007F0000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        0000000000000000000000000000000000000000000000000000000000000000
        00000000000000000000000000000000000000000000000000000F0F0F0F0F0F
        0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F
        0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F
        0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F
        0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F030303030303030303
        0303030303030F0F0F0F0F0F0F0F161616161616161616161616161616030F0F
        0F0F0F0F0F0F020101010101010101010101010116030F0F0F0F0F0F0F0F0200
        000000000000160C0400000116030F0F0F0F0F0F0F0F0200000C0404040C1006
        1300000116030F0F0F0F0F0F0F0F020000160E0F111005070000000116030F0F
        0F0F0F0F0F0F020000001612100508000000000116030F0F0F0F0F0F0F0F0200
        0000161005070C000000000116030F0F0F0F0F0F0F0F020000161005080E0B0C
        0000000116030F0F0F0F0F0F0F0F02000003000300160D0D1600000116030F0F
        0F0F0F0F0F0F020000000000000000000000000116030F0F0F0F0F0F0F0F1515
        15151515151515151515151516030F0F0F0F0F0F0F0F14090A0A0A0A0A0A0A0A
        0A0A0A0A16030F0F0F0F0F0F0F0F1414141414141414141414141414160F0F0F
        0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F
        0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F
        0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F
        0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F}
      OnClick = SpeedButton1Click
    end
    inherited DBGrid1: TDBGrid
      Top = 230
      Height = 0
      TabOrder = 12
      Columns = <
        item
          Expanded = False
          FieldName = 'GRUP_PROD_DESCRICAO'
          Title.Caption = 'Grupo Produto'
          Width = 81
          Visible = True
        end
        item
          Expanded = False
          FieldName = 'CLASSIFICACAOPRODUTO1'
          Title.Caption = 'Class. Produto1'
          Width = 137
          Visible = True
        end
        item
          Expanded = False
          FieldName = 'CLASSIFICACAOPRODUTO2'
          Title.Caption = 'Class. Produto2'
          Width = 156
          Visible = True
        end
        item
          Expanded = False
          FieldName = 'CLASSIFICACAOPRODUTO3'
          Title.Caption = 'Class. Produto3'
          Width = 188
          Visible = True
        end
        item
          Expanded = False
          FieldName = 'PROD_DESCRICAOENT'
          Title.Caption = 'Produto'
          Visible = True
        end
        item
          Expanded = False
          FieldName = 'PROD_REFERENCIA'
          Title.Caption = 'Refer'#234'ncia'
          Visible = True
        end
        item
          Expanded = False
          FieldName = 'PROD_UNIDSAIDA'
          Title.Caption = 'Unidade Sa'#237'da'
          Width = 79
          Visible = True
        end
        item
          Expanded = False
          FieldName = 'FORN_RAZAO'
          Title.Caption = 'Fornecedor'
          Visible = True
        end
        item
          Expanded = False
          FieldName = 'QUANTIDADE'
          Title.Caption = 'Quantidade'
          Visible = True
        end
        item
          Expanded = False
          FieldName = 'SAL_EST_CUSTOMEDIOUNIT'
          Title.Caption = 'Custo M'#233'dio Unit'#225'rio'
          Visible = True
        end
        item
          Expanded = False
          FieldName = 'CUSTOMEDIOTOTAL'
          Title.Caption = 'Custo M'#233'dio Total'
          Width = 93
          Visible = True
        end
        item
          Expanded = False
          FieldName = 'SAL_EST_CUSTOREPOSICAO'
          Title.Caption = 'Custo Reposi'#231#227'o'
          Width = 91
          Visible = True
        end>
    end
    inherited Panel3: TPanel
      Top = 270
      TabOrder = 11
    end
    object DBLCBLocal: TDBLookupComboBox
      Left = 5
      Top = 14
      Width = 197
      Height = 19
      Ctl3D = False
      KeyField = 'LOC_CODIGO'
      ListField = 'LOC_DESCRICAO'
      ListSource = DSLocal
      ParentCtl3D = False
      TabOrder = 0
      OnKeyDown = DBLCBLocalKeyDown
    end
    object DTSaldo: TDateEdit
      Left = 297
      Top = 58
      Width = 104
      Height = 19
      Ctl3D = False
      NumGlyphs = 2
      ParentCtl3D = False
      TabOrder = 3
      OnEnter = DTSaldoEnter
    end
    object DBLCBGrupoProduto: TDBLookupComboBox
      Left = 205
      Top = 14
      Width = 197
      Height = 19
      Ctl3D = False
      KeyField = 'GRUP_PROD_CODIGO'
      ListField = 'GRUP_PROD_DESCRICAO'
      ListSource = DSGrupoProduto
      ParentCtl3D = False
      TabOrder = 1
      OnKeyDown = DBLCBLocalKeyDown
    end
    object RGAgrupaRelatorio: TRadioGroup
      Left = 5
      Top = 165
      Width = 262
      Height = 32
      Caption = '  Agrupar por  '
      Columns = 3
      Ctl3D = False
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -7
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      ItemIndex = 0
      Items.Strings = (
        'Fornecedor'
        'Classifica'#231#227'o'
        'Grupo')
      ParentCtl3D = False
      ParentFont = False
      TabOrder = 7
      OnClick = RGAgrupaRelatorioClick
    end
    object CkBTodasEmpresas: TCheckBox
      Left = 5
      Top = 205
      Width = 115
      Height = 17
      Caption = 'Todas as Empresas'
      TabOrder = 9
      OnClick = CkBTodasEmpresasClick
    end
    object CLBEmpresas: TCheckListBox
      Left = 1
      Top = 230
      Width = 409
      Height = 40
      Align = alBottom
      Columns = 1
      Ctl3D = False
      ItemHeight = 13
      ParentCtl3D = False
      TabOrder = 10
    end
    object DBLCBNivel1: TDBLookupComboBox
      Left = 77
      Top = 92
      Width = 241
      Height = 19
      Ctl3D = False
      DataField = 'PROD_CLASSIFPROD1'
      KeyField = 'CLASS_PROD_CODIGO'
      ListField = 'CLASS_PROD_DESCRICAO'
      ListSource = DSNivel1
      ParentCtl3D = False
      TabOrder = 4
      OnExit = DBLCBNivel2Enter
      OnKeyDown = DBLCBLocalKeyDown
    end
    object DBLCBNivel2: TDBLookupComboBox
      Left = 93
      Top = 116
      Width = 241
      Height = 19
      Ctl3D = False
      DataField = 'PROD_CLASSIFPROD2'
      Enabled = False
      KeyField = 'CLASS_PROD_CODIGO'
      ListField = 'CLASS_PROD_DESCRICAO'
      ListSource = DSNivel2
      ParentCtl3D = False
      TabOrder = 5
      OnEnter = DBLCBNivel2Enter
      OnExit = DBLCBNivel3Enter
      OnKeyDown = DBLCBNivel2KeyDown
    end
    object DBLCBNivel3: TDBLookupComboBox
      Left = 110
      Top = 140
      Width = 241
      Height = 19
      Ctl3D = False
      DataField = 'PROD_CLASSIFPROD3'
      Enabled = False
      KeyField = 'CLASS_PROD_CODIGO'
      ListField = 'CLASS_PROD_DESCRICAO'
      ListSource = DSNivel3
      ParentCtl3D = False
      TabOrder = 6
      OnEnter = DBLCBNivel3Enter
      OnKeyDown = DBLCBNivel3KeyDown
    end
    object RGNivel: TRadioGroup
      Left = 266
      Top = 165
      Width = 116
      Height = 32
      Caption = '  N'#237'vel  '
      Columns = 3
      Ctl3D = False
      Items.Strings = (
        '1'
        '2'
        '3')
      ParentCtl3D = False
      TabOrder = 8
      OnClick = RGNivelClick
    end
    object DBLCBFornecedor: TDBLookupComboBox
      Left = 5
      Top = 58
      Width = 284
      Height = 19
      Ctl3D = False
      KeyField = 'FORN_CODIGO'
      ListField = 'FORN_RAZAO'
      ListSource = DSFornecedor
      ParentCtl3D = False
      TabOrder = 2
      OnKeyDown = DBLCBLocalKeyDown
    end
  end
  inherited QPesquisa: TQuery
    SQL.Strings = (
      
        'Select Prod_Codigo,Prod_DescricaoEnt,Prod_Referencia,Prod_UnidSa' +
        'ida,Forn_Razao,Sum(SAL_LOC_QUANTIDADEEST) as Quantidade,SAL_EST_' +
        'CUSTOMEDIOUNIT,'
      
        '(Sum(SAL_LOC_QUANTIDADEEST) * SAL_EST_CUSTOMEDIOUNIT ) as CustoM' +
        'edioTotal, SAL_EST_CUSTOREPOSICAO,'
      
        'GRUP_PROD_DESCRICAO,ClassProd1.CLASS_PROD_DESCRICAO as Classific' +
        'acaoProduto1,ClassProd2.CLASS_PROD_DESCRICAO as ClassificacaoPro' +
        'duto2,ClassProd3.CLASS_PROD_DESCRICAO as ClassificacaoProduto3'
      ''
      'From PRODUTO'
      
        'Inner join GRUPOPRODUTO on PRODUTO.PROD_GRUPOPRODUTO = GRUPOPROD' +
        'UTO.GRUP_PROD_CODIGO'
      
        'Inner join CLASSIFICACAOPRODUTO ClassProd1 on PRODUTO.PROD_CLASS' +
        'IFPROD1 = ClassProd1.CLASS_PROD_CODIGO'
      
        'Inner join CLASSIFICACAOPRODUTO ClassProd2 on PRODUTO.PROD_CLASS' +
        'IFPROD2 = ClassProd2.CLASS_PROD_CODIGO'
      
        'Inner join CLASSIFICACAOPRODUTO ClassProd3 on PRODUTO.PROD_CLASS' +
        'IFPROD3 = ClassProd3.CLASS_PROD_CODIGO'
      
        'Left join PRODUTOFORNECEDOR on PRODUTO.PROD_CODIGO  = PRODUTOFOR' +
        'NECEDOR.PRODFORN_PRODUTO'
      
        'Inner join FORNECEDOR on FORNECEDOR.FORN_CODIGO = PRODUTOFORNECE' +
        'DOR.PRODFORN_FORNECEDOR'
      
        'Inner join SALDOLOCAL on PRODUTO.PROD_CODIGO = SALDOLOCAL.SAL_LO' +
        'C_PRODUTO'
      
        'Inner join SALDOESTOQUE on PRODUTO.PROD_CODIGO = SALDOESTOQUE.SA' +
        'L_EST_PRODUTO'
      ''
      ''
      
        'Group by Forn_Razao,Prod_Codigo,Prod_DescricaoEnt,Prod_Referenci' +
        'a,Prod_UnidSaida,SAL_EST_CUSTOMEDIOUNIT,SAL_EST_CUSTOREPOSICAO'
      ',ClassProd1.CLASS_PROD_DESCRICAO'
      ',ClassProd2.CLASS_PROD_DESCRICAO'
      ',ClassProd3.CLASS_PROD_DESCRICAO'
      ',GRUP_PROD_DESCRICAO'
      '')
    Left = 240
    Top = 321
  end
  inherited DSPesquisa: TDataSource
    Top = 329
  end
  object DSLocal: TDataSource
    DataSet = DMGestao.QLocal
    Left = 240
    Top = 312
  end
  object DSGrupoProduto: TDataSource
    DataSet = DMGestao.QGrupProduto
    Left = 328
    Top = 288
  end
  object DSNivel1: TDataSource
    DataSet = QClassifProdutoNivel1
    Left = 263
    Top = 308
  end
  object DSNivel2: TDataSource
    DataSet = QClassifProdutoNivel2
    Left = 200
    Top = 300
  end
  object DSNivel3: TDataSource
    DataSet = QClassifProdutoNivel3
    Left = 264
    Top = 324
  end
  object DSFornecedor: TDataSource
    DataSet = DMGestao.QFornecedor
    Left = 280
    Top = 304
  end
  object QClassifProdutoNivel1: TQuery
    DatabaseName = 'base'
    SQL.Strings = (
      
        'select Class_Prod_Codigo,Class_Prod_Descricao from Classificacao' +
        'Produto'
      
        'Where  (Class_Prod_Nivel1 is null) and (Class_Prod_Nivel2 is nul' +
        'l)'
      ''
      'Order by Class_Prod_Descricao')
    Left = 248
    Top = 290
  end
  object QClassifProdutoNivel2: TQuery
    DatabaseName = 'base'
    SQL.Strings = (
      
        'select Class_Prod_Codigo,Class_Prod_Descricao from Classificacao' +
        'Produto'
      
        'Where  Not( (Class_Prod_Nivel1 is null) ) and (Class_Prod_Nivel2' +
        ' is null)'
      ''
      'Order by Class_Prod_Descricao'
      ';')
    Left = 168
    Top = 315
  end
  object QClassifProdutoNivel3: TQuery
    DatabaseName = 'base'
    SQL.Strings = (
      
        'select Class_Prod_Codigo,Class_Prod_Descricao from Classificacao' +
        'Produto'
      
        'Where  (Class_Prod_Nivel1 is null) and Not((Class_Prod_Nivel2 is' +
        ' null) )'
      ''
      'Order by Class_Prod_Descricao'
      ';')
    Left = 233
    Top = 326
  end
end
